home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-18 | 4.9 KB | 109 lines | [TEXT/MPS ] |
-
- DumpSRec -- an MPW Tool
-
- Written by Craig Prouse of Apple Developer Technical Support
- Special thanks to C.K. Haun for the original Commando interface!
- Copyright © 1990-91, Apple Computer, Inc. -- ALL RIGHTS RESERVED
-
- This tool converts an arbitrary Macintosh data file or resource into
- Motorola S-Record format, most likely to assist in downloading code
- and data to EPROM programmers or non-Macintosh target platforms.
-
- Command line syntax:
-
- DumpSRec # write resource or data in S-Record format
- DumpSRec [option…] fileName > dump ≥ progress
- -a addr # dump to hexadecimal target address (default = 0)
- -b count # include count data bytes per record (default = 32)
- -h # suppress S0 header record
- -nh # specify new data for the S0 header record
- -rt type[=id] # dump resource with this type and id (default is data fork)
- -s1 # generate S1 records, 2-byte addresses (default)
- -s2 # generate S2 records, 3-byte addresses
- -s3 # generate S3 records, 4-byte addresses
- -x addr # hexadecimal target execution address (default = 0)
-
-
-
-
- NOTES 1.0d1 -- 9/20/90
- ======================
-
- This is a development version MPW tool created in response to the requests by a number
- of Apple developers for just such a tool. It can take just about any Macintosh file,
- data or resource, and dump the contents in Motorola S-Record format. Currently, this
- tool dumps its output to standard output. Since the goal is typically to send the
- data to another platform, you will need either a communications program to send the
- resulting ASCII file, or another MPW tool which takes standard input and routes it
- directly to the Serial Driver. This solution could take the form of:
-
- DumpSRec [option…] fileName | Stdin2Serial [maybe another option…]
-
- Unfortunately, I don't have the time or motivation to write Stdin2Serial right now.
-
- DumpSRec should be pretty stable, but all feedback is welcome. In particular, let me
- know how you'd like to see the S0 header option implemented. Currently, the default is
- to generate an S0 record based on the contents of SHDR resource 0, which looks like:
-
- Address 2 bytes typically 0
- Count 2 bytes count of following data, should be ≤ 252
- Data (Count) bytes user-defined data for the S0 record
-
- I'd really like a better solution to this, but this was the best I could come up with
- for now. One known problem is this: if you edit the SHDR resource with MPW open after
- using DumpSRec at least once, subsequent invocations of DumpSRec may not recognize
- that the resource has been changed. I think this is a problem with a stale resource
- map, but I don't have the energy to track it down and I don't like this solution in
- the first place. Suggestions anyone?
-
- I intend to release the source code to this tool as a DTS sample when all the bugs
- are out of it, so the sooner I get good input, the sooner everyone gets a better
- MPW Tool example.
-
-
-
- NOTES 1.0d2 -- 10/30/90
- ======================
-
- Version 1.0d2 improves on a few shortfalls of the previous version. Changes include a
- few minor bug fixes and a couple of enhancements. Most importantly, DumpSRec now has
- a dialog for entry of the S0 header (convenient for ASCII data, at least). I think
- you will find this much superior to the previous strategy of editing the tool itself
- with ResEdit. The dialog can be invoked by adding the new command-line option -nh.
-
- Furthermore, the last specified header is stored in a preferences file in the System
- Folder and will be used for subsequent dumps unless suppressed by the -h option. If
- it is necessary to edit the header resource directly, to represent binary data for
- instance, it is better to edit the 'SHDR' resource in the preferences file than to
- edit the DumpSRec tool directly.
-
- Under System 7.0, DumpSRec will properly put its preferences file in the appropriate
- subfolder of the System Folder.
-
- I've significantly rearranged the Commando dialog, looking for a more logical layout.
- I think the current look is more attractive. There are a couple of new items in the
- dialog as well. One (bytes per line) was inadvertantly omitted from version d1, and
- the other represents the new -nh option.
-
- Other changes include slight improvements in some of the error messages and checks to
- insure that no header will be generated unless data is actually going to follow.
-
-
-
- NOTES 1.0d3 -- 6/3/91
- ======================
-
- This version is functionally identical to 1.0d2. The main changes were in order to
- make the source compile under the final version of MPW 3.2. It is now simpler to test
- for presence of FSSpec calls, and FindFolder is a given. A window centering routine was
- gratutitously updated with a newer version, since I happened to have it available, and a
- number of unnecessary constants and globals were removed.
-
- The main reason for all of this is so I can actually follow through on my promise and
- release the source code. It's now as ready as it's going to be.
-
-
-
- Craig Prouse
- AppleLink: MACDTS
-